/**********************************************************************
 Replication do-file
 Paper: Mona Lisa Isn't Smiling Anymore
 Author: Elisabetta Mannoni (2025)
 Journal: Italian Political Science Review
**********************************************************************/

clear all
set more off
version 18


*------------------------------------------------------*
* 0) BEFORE STARTING
*------------------------------------------------------*
* EDIT THIS PATH below with your own pathname:
global project "/Users/..."

global outputs    "$project/outputs"
global tables     "$outputs/tables"
global figures    "$outputs/figures"
global logs       "$outputs/logs"

capture mkdir "$project"
capture mkdir "$outputs"
capture mkdir "$tables"
capture mkdir "$figures"
capture mkdir "$logs"

* Optional: start a log
capture log close
log using "$logs/replication.log", replace text

*------------------------------------------------------*
* Load data
*------------------------------------------------------*
use "MonaLisa_Mannoni2025.dta", clear

*------------------------------------------------------*
* 1) Socio-demographics (recodes)
*------------------------------------------------------*

* Gender
gen gndr = D03
tab gndr D03
recode gndr (1=1)(2=0)(3 99=.)
tab gndr D03
* 0 = man, 1 = woman
* Note: 2 non-binary and 1 "prefer not to say" are set to missing (category too small for regression)

* Birth year -> generations
recode D02 ///
    (1930/1964 = 1 "Silent and Baby Boomers") ///
    (1965/1980 = 2 "Generation X") ///
    (1981/1996 = 3 "Generation Y (Millennials)") ///
    (1997/2006 = 4 "Generation Z"), generate(gens)
tab gens

* Economic situation (financial hardship)
tab D43
recode D43 (1 2 = 1)(3 4 = 0)(else=.), gen(finhard)
la var finhard "financial hardship"
tab finhard D43
* 0 = easy, 1 = hard

* Education level
tab D42
recode D42 (2 3=1 "up to middle school")(4=2 "high school")(5=3 "university")(else=.), gen(edu)
la var edu "level of education"
tab D42 edu

* Political preferences (left-right self-placement)
gen lrscale = D08_1
recode lrscale (96=.)
la var lrscale "LR self placement"
tab D08_1 lrscale

recode lrscale (1 2 = 1 "sx")(3 4 = 2 "csx")(5 6 = 3 "centro")(7 8 = 4 "cdx")(9 10 = 5 "dx"), gen(lrscale5)
la var lrscale5 "LR self placement, 5 cat"
tab lrscale lrscale5

recode lrscale (1 2 3= 1 "sx")(4 5 = 2 "csx")(6 7 = 3 "cdx")(8 9 10= 4 "dx"), gen(lrscale4)
la var lrscale4 "LR self placement, 4 cat"
tab lrscale lrscale4

*------------------------------------------------------*
* 2) Treatment + tactic disapproval
*------------------------------------------------------*
recode D37rand (1=1 "treatment")(2=0 "control"), gen(treatment)
la var treatment "treatment group"
tab D37rand treatment

gen noncondivido = D37
recode noncondivido (99 1 =0) (2=1)
la var noncondivido "dislikes art-targeting eco-activism"
tab D37 noncondivido
tab D37

*------------------------------------------------------*
* 3) Dependent variables (paper outcomes)
*------------------------------------------------------*

* Environmental concern (worry) – dichotomous used in regressions
recode D39 (1 2=0 "little/not at all")(3 4=1 "very/extremely"), gen(pec01)
la var pec01 "environmental concern dummy"
tab D39 pec01

* Items (recode direction as in your code)
recode D38_1 (0=1)(1=0), gen(envatt1)
la var envatt1 "Climate change is not dependent on human action"

recode D38_2 (0=0)(1=1), gen(envatt2)
la var envatt2 "I feel a moral responsibility to contribute to protecting the environment"

recode D38_3 (0=0)(1=1), gen(envatt3)
la var envatt3 "The government should protect the environment even at the cost of increasing taxes"

recode D38_4 (0=1)(1=0), gen(envatt4)
la var envatt4 "Much of what is said today about environmental threats is exaggerated"

recode D38_5 (0=1)(1=0), gen(envatt5)
la var envatt5 "It's pointless to do what I can for the environment if others don't do the same"

rename envatt1 denialism1
rename envatt4 denialism2
rename envatt2 mobligation
rename envatt3 policy
rename envatt5 refficacy

* Pro-environmental behavior intentions (binary outcomes)
tab D40a
recode D40a (1 2=0 "no protest")(3 4=1 "yes protest"), gen(peb_protest)
la var peb_protest "would you ever protest"

tab D40b
recode D40b (1 2=0 "no petition")(3 4=1 "yes petition"), gen(peb_petition)
la var peb_petition "would you ever sign petition"

tab D40c
recode D40c (1 2=0 "no online")(3 4=1 "yes online"), gen(peb_online)
la var peb_online "would you ever online activism"

* Pro-environmental voting (PEV) recode as in your code
gen pev = D41
replace pev = 22 if D41 == 1
replace pev = 20 if D41 == 6
replace pev = 6  if D41 == 2
replace pev = 2  if D41 == 9
replace pev = -5 if D41 == 5
replace pev = -5 if D41 == 4
replace pev = -6 if D41 == 3
replace pev = .  if D41 == 7 | D41 == 8 | D41 == 94 | D41 == 99

gen pev2 = .
replace pev2=1 if pev== -6
replace pev2=2 if pev== -5
replace pev2=3 if pev== 2
replace pev2=4 if pev== 6
replace pev2=5 if pev== 20
replace pev2=6 if pev== 22
tab pev2 pev

* Donation behavior
recode Fine (1=0 "keep bonus")(2 3 4=1 "donate bonus"), gen(donation)
la var donation "pro-environmental behavior: donation"
tab Fine donation

********************** ANALYSIS ************************

*---------------------------------------------------------------------------
* Replication notes
*---------------------------------------------------------------------------
* Figures in the manuscript are produced using Stata margins and marginsplot.
* Manual edits to labels, font sizes, and colors were applied after export
* for publication purposes only. Such edits do not affect the estimates.
*---------------------------------------------------------------------------

*------------------------------------------------------*
* 4) Appendix B tables A1–A11 (three specs each)
*    Treatment-only / Socio-demo / Ideology
*------------------------------------------------------*

* ssc install estout, replace
* ssc install coefplot, replace

///////////// 1) CLIMATE CHANGE WORRY (Table A1)
logit pec01 treatment, robust
estimates store spec1
logit pec01 treatment gndr i.gens finhard edu, robust
estimates store spec2
logit pec01 treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/pec01_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 1: Climate change worry (pec01)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 2) RESPONSE EFFICACY (Table A2)
logit refficacy treatment, robust
estimates store spec1
logit refficacy treatment gndr i.gens finhard edu, robust
estimates store spec2
logit refficacy treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/refficacy_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 2: Response efficacy (refficacy)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 3) MORAL OBLIGATION (Table A3)
logit mobligation treatment, robust
estimates store spec1
logit mobligation treatment gndr i.gens finhard edu, robust
estimates store spec2
logit mobligation treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/mobligation_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 3: Moral obligation (mobligation)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 4) DENIALISM 1 (Table A4)
logit denialism1 treatment, robust
estimates store spec1
logit denialism1 treatment gndr i.gens finhard edu, robust
estimates store spec2
logit denialism1 treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/denialism1_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 4: Denialism 1 (denialism1)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 5) DENIALISM 2 (Table A5)
logit denialism2 treatment, robust
estimates store spec1
logit denialism2 treatment gndr i.gens finhard edu, robust
estimates store spec2
logit denialism2 treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/denialism2_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 5: Denialism 2 (denialism2)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 6) POLICY (Table A6)
logit policy treatment, robust
estimates store spec1
logit policy treatment gndr i.gens finhard edu, robust
estimates store spec2
logit policy treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/policy_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 6: Policy preference (policy)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 7) PEB – PROTEST (Table A7)
logit peb_protest treatment, robust
estimates store spec1
logit peb_protest treatment gndr i.gens finhard edu, robust
estimates store spec2
logit peb_protest treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/peb_protest_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 7: Joining protest (peb_protest)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 8) PEB – PETITION (Table A8)
logit peb_petition treatment, robust
estimates store spec1
logit peb_petition treatment gndr i.gens finhard edu, robust
estimates store spec2
logit peb_petition treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/peb_petition_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 8: Signing petition (peb_petition)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 9) PEB – ONLINE (Table A9)
logit peb_online treatment, robust
estimates store spec1
logit peb_online treatment gndr i.gens finhard edu, robust
estimates store spec2
logit peb_online treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/peb_online_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 9: Online activism (peb_online)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 10) PEV (Table A10)
regress pev2 treatment, robust
estimates store spec1
regress pev2 treatment gndr i.gens finhard edu, robust
estimates store spec2
regress pev2 treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/pev2_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 10: Pro-environmental voting (pev2)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

///////////// 11) DONATION (Table A11)
logit donation treatment, robust
estimates store spec1
logit donation treatment gndr i.gens finhard edu, robust
estimates store spec2
logit donation treatment gndr i.gens finhard edu lrscale, robust
estimates store spec3
eststo clear
esttab spec1 spec2 spec3 using "$tables/donation_table.tex", ///
    replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
    title("Outcome 11: Donating money (donation)") ///
    collabels("Treatment only" "Socio-demo" "Ideology") ///
    varlabels(treatment "Treatment" gndr "Gender" i.gens "Generation" ///
              finhard "Financial hardship" edu "Education" lrscale "Left-right scale") ///
    alignment(center) ///
    compress

*------------------------------------------------------*
* 5) Paper Figure 4: treatment effects across outcomes 
*------------------------------------------------------*
logit pec01 treatment, robust
estimates store pec01_model

logit refficacy treatment, robust
estimates store refficacy_model

logit mobligation treatment, robust
estimates store mobligation_model

logit denialism1 treatment, robust
estimates store denialism1_model

logit denialism2 treatment, robust
estimates store denialism2_model

logit policy treatment, robust
estimates store policy_model

logit peb_protest treatment, robust
estimates store peb_protest_model

logit peb_petition treatment, robust
estimates store peb_petition_model

logit peb_online treatment, robust
estimates store peb_online_model

regress pev2 treatment, robust
estimates store pev2_model

logit donation treatment, robust
estimates store donation_model

coefplot (pec01_model, label("") mlab("Climate Change Worry") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (refficacy_model, label("") mlab("Response Efficacy") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (mobligation_model, label("") mlab("Moral Obligation") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (denialism1_model, label("") mlab("Denialism 1") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (denialism2_model, label("") mlab("Denialism 2") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (policy_model, label("") mlab("Policy Preference") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (peb_protest_model, label("") mlab("Joining Protest") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (peb_petition_model, label("") mlab("Signing Petition") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (peb_online_model, label("") mlab("Online Activism") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (pev2_model, label("") mlab("Pro-Environmental Voting") mcolor(black) lcolor(black) fcolor(gs14)) ///
         (donation_model, label("") mlab("Donation Behavior") mcolor(black) lcolor(black) fcolor(gs14)), ///
    keep(treatment) drop(_cons) ///
    xline(0, lcolor(black)) ///
    ylabel(, nolabel) ///
    ytitle("Treatment", color(black)) ///
    xlabel(-1(0.5)1, labcolor(black)) ///
    title("") ///
    mlabpos(12) mlabgap(0.3) ///
    legend(off)

graph export "$figures/figure4_coefplot_treatment.png", width(3000) replace

*------------------------------------------------------*
* 6) Paper Table 3: tactic disapproval (treat_endorse)
*------------------------------------------------------*

gen treat_endorse = .
replace treat_endorse = 1 if treatment == 0
replace treat_endorse = 2 if treatment == 1 & noncondivido == 0
replace treat_endorse = 3 if treatment == 1 & noncondivido == 1

label define treat_endorse_labels 1 "control" 2 "treat_condivido" 3 "treat_noncondivido"
label values treat_endorse treat_endorse_labels

* Political interest (used later in Appendix D figure)
tab D07
recode D07 (1=1 "Not at all interested")(2=2 "A little interested")(3=3 "Quite interested")(4=4 "Very interested")(else=.), gen(polint)
tab polint D07

logit pec01 i.treat_endorse, robust
eststo pec01_model
logit refficacy i.treat_endorse, robust
eststo refficacy_model
logit denialism1 i.treat_endorse, robust
eststo denialism1_model
logit denialism2 i.treat_endorse, robust
eststo denialism2_model
logit mobligation i.treat_endorse, robust
eststo mobligation_model
logit policy i.treat_endorse, robust
eststo policy_model
logit peb_protest i.treat_endorse, robust
eststo peb_protest_model
logit peb_petition i.treat_endorse, robust
eststo peb_petition_model
logit peb_online i.treat_endorse, robust
eststo peb_online_model
regress pev2 i.treat_endorse, robust
eststo pev_model
logit donation i.treat_endorse, robust
eststo donation_model

esttab pec01_model refficacy_model denialism1_model denialism2_model ///
       mobligation_model policy_model peb_protest_model peb_petition_model ///
       peb_online_model pev_model donation_model ///
       using "$tables/table3_treat_endorse_models.tex", ///
       replace label b se star(* 0.10 ** 0.05 *** 0.01) ///
       title("Table 3: Regression results of tactic disapproval") ///
       collabels(none) ///
       alignment(center) ///
       compress

eststo clear

*------------------------------------------------------*
* 7) Paper Figure 5: treatment × ideology (lrscale5)
*------------------------------------------------------*

label define lrscale5_la 1 "Radical Left" 2 "Center-Left" 3 "Center" 4 "Center-Right" 5 "Radical Right"
label values lrscale5 lrscale5_la

local depvars pec01 refficacy denialism1 denialism2 mobligation policy ///
              peb_protest peb_petition peb_online pev2 donation

foreach dv in `depvars' {
    if "`dv'" != "pev2" {
        logit `dv' treatment ib3.lrscale5 c.treatment#ib3.lrscale5, robust
    }
    else {
        regress `dv' treatment ib3.lrscale5 c.treatment#ib3.lrscale5, robust
    }

    margins lrscale5, at(treatment=(0 1)) post
    marginsplot, xdimension(lrscale5) ///
        xlabel(1 "Radical Left" 2 "Center-Left" 3 "Center" 4 "Center-Right" 5 "Radical Right") ///
        title("`dv'") ///
        plot1opts(lcolor(black) lwidth(thin) lpattern(dash)) ///
        plot2opts(lcolor(black) lwidth(medium) lpattern(solid)) ///
        ciopts(color(black)) ///
        legend(off)

    graph save "$figures/plot_`dv'_lrscale5.gph", replace
}

graph combine "$figures/plot_pec01_lrscale5.gph" "$figures/plot_refficacy_lrscale5.gph" ///
              "$figures/plot_denialism1_lrscale5.gph" "$figures/plot_denialism2_lrscale5.gph" ///
              "$figures/plot_mobligation_lrscale5.gph" "$figures/plot_policy_lrscale5.gph" ///
              "$figures/plot_peb_protest_lrscale5.gph" "$figures/plot_peb_petition_lrscale5.gph" ///
              "$figures/plot_peb_online_lrscale5.gph" "$figures/plot_pev2_lrscale5.gph" ///
              "$figures/plot_donation_lrscale5.gph", ///
              rows(2) title("Figure 5: Effect of treatment by ideological self-placement")

graph export "$figures/figure5_margins_by_ideology.png", width(3000) replace

*------------------------------------------------------*
* 8) Appendix C Figure 2: conditional marginal effects by past vote
*------------------------------------------------------*

rename D09 pastvote
label define pastvotemain 1 "FDI" 2 "Lega" 3 "FI" ///
                      4 "M5S" 5 "PD" 6 "AVS"

gen pastvotemain = .
replace pastvotemain = 1 if pastvote == 1
replace pastvotemain = 2 if pastvote == 2
replace pastvotemain = 3 if pastvote == 3
replace pastvotemain = 4 if pastvote == 5
replace pastvotemain = 5 if pastvote == 6
replace pastvotemain = 6 if pastvote == 8
label values pastvotemain pastvotemain

logit pec01 i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Climate worry") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_pec01, replace)

logit refficacy i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Response efficacy") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_refficacy, replace)

logit denialism1 i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Denialism 1") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_denialism1, replace)

logit denialism2 i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Denialism 2") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_denialism2, replace)

logit mobligation i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Moral obligation") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_mobligation, replace)

logit policy i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Policy preference") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_policy, replace)

logit peb_protest i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Joining protest") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_protest, replace)

logit peb_petition i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Signing petition") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_petition, replace)

logit peb_online i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Online activism") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_online, replace)

regress pev i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Pro-environmental voting") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_pev, replace)

logit donation i.treatment##i.pastvotemain, robust
margins pastvotemain, dydx(treatment)
marginsplot, ///
    ytitle("Marginal effect of treatment") ///
    xtitle("Past vote (selected parties)") ///
    xlabel(1(1)6, valuelabel angle(45) labsize(small)) ///
    title("Donation") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(g_donation, replace)

graph combine g_pec01 g_refficacy g_denialism1 g_denialism2 g_mobligation ///
              g_policy g_protest g_petition g_online g_pev g_donation, ///
              col(4) row(3) ///
              title("Appendix C Figure 2: Conditional marginal effects by past vote") ///
              note("Error bars represent 95% confidence intervals. Estimates are based on logit or OLS models with treatment × past vote interactions.") ///
              iscale(0.8)

graph export "$figures/appendixC_figure2_margins_pastvote.png", width(3000) replace

*---------------------------------------------------------------------------*
* 9) Appendix D Figure 3: conditional marginal effects by political interest (polint)
*---------------------------------------------------------------------------*

logit pec01 i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Climate worry") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_pec01, replace)

logit refficacy i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Response efficacy") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_refficacy, replace)

logit denialism1 i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Denialism 1") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_denialism1, replace)

logit denialism2 i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Denialism 2") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_denialism2, replace)

logit mobligation i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Moral obligation") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_mobligation, replace)

logit policy i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Policy preference") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_policy, replace)

logit peb_protest i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Joining protest") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_protest, replace)

logit peb_petition i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Signing petition") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_petition, replace)

logit peb_online i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Online activism") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_online, replace)

regress pev i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Pro-environmental voting") ///
    plotopts(msymbol(circle) lwidth(medthick) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_pev, replace)

logit donation i.treatment##i.polint, robust
margins polint, dydx(treatment)
marginsplot, title("Donation") ///
    plotopts(msymbol(circle) lwidth(thin) lcolor(black)) ///
    ciopts(lwidth(thin) lcolor(black%50)) ///
    name(p_donation, replace)

graph combine p_pec01 p_refficacy p_denialism1 p_denialism2 p_mobligation ///
              p_policy p_protest p_petition p_online p_pev p_donation, ///
              col(3) row(4) ///
              title("Appendix D Figure 3: Conditional marginal effects by political interest") ///
              note("Error bars represent 95% confidence intervals. Estimates based on logit or OLS models with treatment × political interest interactions.") ///
              iscale(0.8)

graph export "$figures/appendixD_figure3_margins_polint.png", width(3000) replace

*------------------------------------------------------*
* END
*------------------------------------------------------*
log close
